<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let salaries = {
        John: 100,
        Ann: 160,
        Pete: 130,
      };
      function sum(obj) {
        let r = 0;
        for (let k in obj) {
          r = r + obj[k];
        }
        return r;
      }
      console.log(sum(salaries)); //390
    </script>
  </body>
</html>
